From eee51d17656890a24957ce53f6eaf57a8c510f62 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Tue, 8 Oct 2024 11:57:49 -0500 Subject: [PATCH] Make the "locals" dict always available for local template variables --- src/pgwui_core/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pgwui_core/forms.py b/src/pgwui_core/forms.py index b7919ec..204e7d8 100644 --- a/src/pgwui_core/forms.py +++ b/src/pgwui_core/forms.py @@ -242,8 +242,11 @@ class LoadedForm(collections.abc.MutableMapping): Input: response Dict of results from connection execution errors List of errors from connection execution + locals Dict used by mako for "local variables" in templates + https://docs.makotemplates.org/en/latest/runtime.html#context-variables ''' response['errors'] = errors + response['locals'] = {} # Template uses this for local vars return response -- 2.34.1